Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


Installing The Device Callback Request

The USBInstallDeviceNotification function installs the device notification routine for the device specified in the USBDeviceNotificationParameterBlock . Pass in 0xffff or the wildcard constants as a wildcard for class, subclass, protocol, vendor, and/or product. Pass in kNotifyAnyEvent (0xff) in the usbDeviceNotification field to be notified for any change that occurs.

void USBInstallDeviceNotification (USBDeviceNotificationParameterBlock *pb);

pb
A pointer to the USBDeviceNotificationParameterBlock defined on Device Notification Parameter Block .

If a code fragment installs a device notification routine, the device notification routine must be removed with the USBRemoveDeviceNotification function before the code fragment is unloaded.

When registering with the USB Manager to be notified when device connections occur, you will also be notified when interfaces are connected to the USB stack. There is a differences between the notification implementation for devices connections and device driver loading and interface connections and interface driver loading. The difference is how the USB stack is informed about the connection.

With composite devices that are handled by the Apple composite driver, the USB stack is told about the interface by virtue of the load interface driver request. This occurs because the Apple composite driver discovers the interface and asks the USB stack to handle it. For vendor specific drivers, the interfaces are not discovered by the Apple composite driver, and the USB stack is not informed or asked to handle the interface.

This means that if a shim or application installs a notification request into the USB Manager for an interface, and the device is handled by a vendor specific driver, then the shim or application won't be notified that the interface was discovered.

Unless a device is managed by the Apple composite driver, the shim or application will not be notified when a device with a particular interface is connected. Even if you have registered for notifications for that interface class and subclass, or is you are watching for a specific interface's class or subclass.


© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next | Show Frames | Hide Frames